package com.mdlib.helper.ui.widget;

import android.content.Context;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import android.widget.TextView;

import com.ljlib.help.R;

/**
 * 作者：HQY on 16/11/15 13:24
 * 邮箱：hqy_xz@126.com
 */

public class VicinityRunDataEngine {

    private static Context mContext;
    private static TextView runTips;


    public static View getCustomFooterView(final Context context) {
        View headerView = View.inflate(context, R.layout.fragment_run_footer, null);
        mContext = context;
        runTips = (TextView) headerView.findViewById(R.id.tv_run_footer);
        return headerView;
    }

    public static void setTips(int num) {
        String runNumber = mContext.getResources().getString(R.string.vicinity_tv_run_tips, num + "");
        SpannableString spanperiod = new SpannableString(runNumber);
        spanperiod.setSpan(new ForegroundColorSpan(mContext.getResources().getColor(R.color.generic_view_bg)), 3, spanperiod.length() - 10, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        runTips.setText(spanperiod);
    }

}
